import { createRouter, createWebHistory } from 'vue-router'
import Login from '../views/Login.vue'
import Page from '../views/Page.vue'
import BookManage from '../components/BookManage.vue'
import UserManage from '../components/UserManage.vue'
import BookDetail from '../components/BookDetail.vue'
import UserDetail from '../components/UserDetail.vue'
import Home from "../views/Home.vue"
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'Login',
      component: Login,
    },
    {
      path: '/detail',
      name: 'BookDetail',
      component: BookDetail,
    },
    {
      path: '/home',
      name: 'Home',
      component: Home,
    },
    {
      path: '/userdetail',
      name: 'UserDetail',
      component: UserDetail,
    },
    {
      path: '/page',
      name: 'Page',
      component: Page,
      children:[
        {
          path: '/book',
          name: 'Book',
          component: BookManage,
        },
        {
          path: '/user',
          name: 'User',
          component: UserManage,
        }
      ]
    }
  ],
})

export default router
